Property Expressions Exercise 3
Exercise 3: SubStrings
Objective
To use SubStr to capture a part of the file name.
Summary
Utilizing the SubStr expression to capture a single character in the file name, ACHAJ010123456789PAIN202001011234.txt, and use that character to rename the file in a second job.
Instructions
Create the File
- Create a file in
C:\ExpressionscalledACHAJ010123456789PAIN202001011234.txt.
Create the Property
- Create a Global Property
- Name:
SubStringExample - Value:
ACHAJ010123456789PAIN202001011234.txt
Create the Schedule
- Create a Schedule named SubString Schedule.
Create the Job
- Create a File Copy Job called, SubStr File Copy, with the following parameters:
- Job Type:
Windows - Job Sub-Type:
Command: File Copy - Primary Machine:
SMATraining - User ID:
SMATRAINING\SMAUSER - Source:
C:\Expressions\[[SubStringExample]] - Destination:
C:\Expressions\ACH_[[=SubStr([[SubStringExample]],18,1)]].txt - Frequency:
MON-FRI-N
Build the Schedule
- Build the Schedule and verify that the proper file was created.
note
Verify that the new file was created with the name ACH_A.txt

Manipulate the Property for a Second File
- Update the source file name and the Global Property to:
ACHAJ010123456789PZIN202001011234.txt - Rerun the Job and verify that file
ACH_Z.txtis created.